﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

/// <summary>
/// Summary description for Category
/// </summary>
namespace Entities
{
    public class Category
    {
        public Category(Int16 categoryId)
        {
            Id = categoryId;
        }
        public Category()
        {
            Id = 0;
        }
        private Int16 _id;
        private String _name;
        private String _description;
        private Int16 _dishId;
        public Int16 RestaurantId;

        public Int16 Id
        {
            get { return _id; }
            set { _id = value; }
        }
        public String Name
        {
            get {return _name;}
            set {_name = value;}
        }
        public String Description
        {
            get { return _description; }
            set { _description = value;}
        }
        public Int16 DishId
        {
            get { return _dishId; }
            set { _dishId = value; }
        }

        private DataSet _reader;
        public DataSet CategoryDishes
        {
            get {
                if (_reader == null)
                    _reader = BLL.Command.GetCategoryDishesByCategory(Id);
                return _reader;
            }
        }
    }
}